package com.webservice.axis;

import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.commons.lang3.StringUtils;


public class TestAxis {
	public static void main(String[] args) throws Exception {
		String endPointURL = "http://www.aa.com:8080/robot/services/User?wsdl";
		//endPointURL = "http://bbs.aa.com:8080/robotbbs/services/User?wsdl";
		String namespace = "http://www.aa.com:8080/robot/services/User";
		//namespace = "http://bbs.aa.com:8080/robotbbs/services/User";
		String param = "";
		org.apache.axis.client.Service service = new org.apache.axis.client.Service(); 
		Call call;
		String res=null;
		try {  
			call = (Call) service.createCall();
			call.setTargetEndpointAddress(endPointURL); // 为Call设置服务的位置
			call.setOperationName(new QName(namespace, "addUser"));
			System.out.println("***************");
			//String bbsUser = (String)call.invoke(new Object[]{"test", "test", "yyy", "yyy", "yyy@qq.com","","",""}); 
			String cmsUser = (String)call.invoke(new Object[]{"test", "test","false","yyy", "yyy", "yyy@qq.com","","",""}); 
			//System.out.println("--------"+bbsUser);
			System.out.println("--------"+cmsUser);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
